<template>
  <EChart ref="EChart" style="width: 100%; height: 100%"></EChart>
</template>

<script>
import EChart from '../../components/echarts/Echarts.vue'
import { pieOption } from './option.js'
export default {
  name: 'pieChart',
  props: {
    pieChartAll: {
      type: Array,
      default: () => []
    }
  },
  components: {
    EChart
  },
  data () {
    return {
    }
  },
  mounted () {
    this.initChart(this.pieChartAll)
  },
  methods: {
    /**
     * 图表绘制
     */
    initChart (data) {
      const option = pieOption(data)
      this.$refs.EChart.initChart(option)
    },
  }
}
</script>
